package com.liqi.frame.comm.exception;

import com.liqi.frame.comm.base.BaseException;
import com.liqi.frame.comm.enums.ResultEnum;

/**
 * 全局异常类
 * @author liqi on 2019/9/6.
 * liqiwork@qq.com
 */
public class GlobalException extends BaseException {
    private Integer code;
    public GlobalException(ResultEnum resultEnum){
        super(resultEnum.getMessage());
        this.code = resultEnum.getCode();
    }

    public GlobalException(ResultEnum resultEnum, String message) {
        super(message);
        this.code = resultEnum.getCode();
    }

    public Integer code(){
        return code;
    }
}
